Skip to content

fix: adapt to new AI Studio login flow - #77

Merged
bbbugg merged 18 commits into
mainfrom
fix/new-ais-login
Feb 21, 2026
Merged

fix: adapt to new AI Studio login flow#77
bbbugg merged 18 commits into
mainfrom
fix/new-ais-login

Conversation

@bbbugg

@bbbugg bbbugg commented Feb 20, 2026

Copy link
Copy Markdown
Member

中文:
由于近期 AIStudio 更新,本分支已调整原有账号登录逻辑,取消了在 blank app 中启动代理的方式(该方式已不支持编辑)。现改为使用开发者预先创建的 app。因此不再支持 WS_PORT 环境变量,端口固定为 9998。

English:
Due to recent AIStudio updates, this branch has modified the original account login logic. The previous approach of starting the proxy within a blank app (which is no longer editable) has been removed. It now uses a pre-created app provided by the developer. As a result, the WS_PORT environment variable is no longer supported, and the port is fixed at 9998.

bbbugg and others added 6 commits February 20, 2026 20:03
- Update target URL to new AI Studio app endpoint
- Add "Continue to the app" button handler
- Remove manual script injection (app has built-in WebSocket client)
- Simplify initialization flow for faster startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add _checkPageErrors() to detect common initialization errors
- Add _waitForWebSocketInit() to monitor browser console logs
- Detect "System initialization complete" for success
- Detect "System initialization failed" for failure
- Check for page errors every second during 60s timeout
- Auto-refresh page on errors (applet failed, concurrent updates, snapshot failed)
- Implement 3-retry mechanism with page refresh between attempts
- Apply to both launchOrSwitchContext and attemptLightweightReconnect

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

This comment was marked as outdated.

This comment was marked as duplicate.

@bbbugg bbbugg changed the title fix: implement new version handling and UI interaction for AI Studio Remix flow fix: adapt to new AI Studio login flow Feb 21, 2026
@bbbugg
bbbugg merged commit 48dbd57 into main Feb 21, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 此 PR 的修改已在版本 v0.7.0 中发布。
🎉 The changes in this PR have been released in version v0.7.0.

@bbbugg bbbugg added the 🐛 Bug Something isn't working label Feb 21, 2026
ouni3 pushed a commit to ouni3/AIStudioToAPI that referenced this pull request Aug 20, 2026
* feat: adapt to new AI Studio login flow

- Update target URL to new AI Studio app endpoint
- Add "Continue to the app" button handler
- Remove manual script injection (app has built-in WebSocket client)
- Simplify initialization flow for faster startup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add robust WebSocket initialization monitoring and error recovery

- Add _checkPageErrors() to detect common initialization errors
- Add _waitForWebSocketInit() to monitor browser console logs
- Detect "System initialization complete" for success
- Detect "System initialization failed" for failure
- Check for page errors every second during 60s timeout
- Auto-refresh page on errors (applet failed, concurrent updates, snapshot failed)
- Implement 3-retry mechanism with page refresh between attempts
- Apply to both launchOrSwitchContext and attemptLightweightReconnect

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat: add health monitor initialization and restart logic

* refactor: simplify WebSocket initialization monitoring and improve flag handling

* refactor: improve WebSocket initialization flow and flag handling

* refactor: enhance WebSocket flag initialization, reuse console listener, and ensure consistent flag resets

* refactor: deprecate WS_PORT env variable, enforce fixed WebSocket port 9998, and update documentation

* chore: remove WS_PORT customization, enforce fixed WebSocket endpoint at 127.0.0.1:9998

* refactor: replace local logger import with class-level logger in ConfigLoader

* fix: correct target URL and simplify app ID validation

* fix: reorder initialization flow with URL validation after popup handling

* fix: skip redundant WebSocket initialization if already completed

* fix: reset WebSocket flags before re-navigation to prevent stale state

* fix: adjust popup handling order to ensure correct URL validation before interactions

* chore: filter out expected WebGL not supported warning in logs

* fix: replace page reload with navigation to target URL for improved popup handling

* fix: add random mouse movement simulation during wait to enhance human-like interaction

* refactor: implement navigation verification and retry mechanism for correct page loading

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 Bug Something isn't working

Projects

None yet

2 participants